import request from "@/utils/request";
import { AxiosPromise } from "axios";
import { QuestionHisVO, QuestionHisQuery, QuestionHisForm } from "./types";

/**
 * 获取问题分页
 * @param queryParams
 */
export function listQuestionHis(
  queryParams?: QuestionHisQuery
): AxiosPromise<MybatisPageResult<QuestionHisVO>> {
  return request({
    url: "buss/question-his/list",
    method: "get",
    params: queryParams,
  });
}

/**
 * 获取问题详情
 *
 * @param userId
 */
export function getQuestionHisForm(id: string): AxiosPromise<QuestionHisForm> {
  return request({
    url: `buss/question-his/one/${id}`,
    method: "get",
  });
}

/**
 * 新增
 *
 * @param data
 */
export function saveQuestionHis(data: QuestionHisForm) {
  return request({
    url: "buss/question-his/save",
    method: "post",
    data,
  });
}

/**
 * 删除
 */
export function deleteQuestionHis(ids: string[]) {
  return request({
    url: "buss/question-his/del",
    method: "post",
    data: ids,
  });
}
